<!DOCTYPE html>
<html xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="utf-8">
    <title>设置我的资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">设置我的资料</div>
                <div class="layui-card-body" pad15>

                    <div class="layui-form" lay-filter="">
                        <div class="layui-form-item">
                            <label class="layui-form-label" >我的角色</label>
                            <div class="layui-input-inline">
                                <input type="text" name="roleName" disabled th:value="${#authentication.principal.role.roleTitle}" value="角色" readonly class="layui-input">
                            </div>
                            <!--<div class="layui-form-mid layui-word-aux">当前角色不可更改为其它角色</div>-->
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮箱</label>
                            <div class="layui-input-inline">
                                <input type="text" name="email" th:value="${#authentication.name}" value="xianxin" readonly class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="name" th:value="${#authentication.principal.name}" value="贤心" lay-verify="nickname" autocomplete="off" placeholder="请输入昵称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">性别</label>
                            <div class="layui-input-block">
                                <input type="radio" th:checked="${#authentication.principal.sex == 1}"name="sex" value="1" title="男">
                                <input type="radio" th:checked="${#authentication.principal.sex == 2}" name="sex" value="2" title="女" checked>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">头像</label>
                            <div class="layui-input-inline">
                                <input name="headImg" lay-verify="required" id="LAY_avatarSrc" placeholder="图片地址" th:value="${#authentication.principal.headImg}" value="http://cdn.layui.com/avatar/168.jpg" class="layui-input">
                            </div>
                            <div class="layui-input-inline layui-btn-container" style="width: auto;">
                                <button type="button" class="layui-btn layui-btn-primary" id="LAY_avatarUpload">
                                    <i class="layui-icon">&#xe67c;</i>上传图片
                                </button>
                                <button class="layui-btn layui-btn-primary" layadmin-event="avartatPreview">查看图片</button >
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">我的班级</label>
                            <div class="layui-input-inline">
                                <select name="classId" lay-verify="required" lay-search="" >
                                    <option value="">搜索/选择班级</option>
                                    <option  th:each="c : ${classList}" th:value="${c.classId}"  th:text="${c.className}" th:selected="${ #authentication.principal.classId == c.classId}" >J1701</option>
                                </select>
                            </div>
                            <div th:if="${ #authentication.principal.classId == 0}" class="layui-form-mid layui-word-aux" style="color:red;">未选择班级，无法提交作业</div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="setmyinfo">确认修改</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set']);
</script>
</body>
</html>